<include file="common_header" />
<style>
.item{
	width:220px;
	float:left;
	margin:10px 10px 0 0;
	display:inline;
}
.item2{
	width:400px;
	float:left;
	margin:10px 10px 0 0;
	display:inline;
}
.num_lite{
	font-size:10px;
	color:#999999;
	text-decoration:underline;
}
.money_num{
	cursor:pointer;
}
.info_lite{
	width:50px;
	position:absolute;
	padding:3px;
	line-height:20px;
	display:none;
	
	background:#537DC1;
	color:#FFFFFF;
	border:#FFFFFF 1px solid;
}
.info_lite a{
	color:#FFFFFF;
}

.weekday{
	font-weight:normal;	
	font-size:10px;
}
.day_sum{
	font-weight:bold;
	cursor:pointer;
}

.report_chart_table{
	display:none;
}
.report_chart{
	height:200px;
}
.report_chart_item{
	float:left;
	width:20px;
	margin-left:2px;
}
.report_chart_item_show{
	background:#4572BC;
}
.report_chart_item_date{
	color:#4572BC;
	height:20px;
}
</style>
<script>
$(function(){
	$('.day_sum').click(function(){
		$(this).parent().parent().parent().children('tr').children('td').children('input').click();
		$(this).parent().parent().parent().children('tr').children('td').children('input').click();
	});
});
</script>
<div class="info_lite"></div>

<foreach name="res" item="row">
	<div class="item">
		<table>
			<tr>
				<th colspan="4">
					{$row.info.time|date='n月d日',###}
					<span class="weekday">{$row.info.time|date='l',###}</span>
				</th>
			</tr>
		<foreach name="row.data" item="row2">
			<tr class='item_one'>
				<td width="20"><input type="checkbox" title="{$row2.amount}" /></td>
				<td>{$row2.inc_name}</td>
				<td width="50" class="money_num">
					{$row2.amount|money_num=###}
					<span style="display:none;" class="item_edit">
						<a href="inc_edit/inc_id/{$row2.inc_id}" title="{$row2.create_time|date='Y-m-d',###}">编辑</a>
						<br />
						<a href="inc_delete/inc_id/{$row2.inc_id}">删除</a>
						<br />
						<a href="#" onclick="$(this).parent().hide();return false;">关闭</a>
					</span>
				</td>
			</tr>
		</foreach>
			<tr>
				<td colspan="4">
					 <span class="day_sum">{$row.info.sum|money_num=###}</span>
				</td>
			</tr>
		</table> 
	</div>
</foreach>

<!--start.clear-->
<div style="clear:both;height:0;"></div>
<!--end.clear-->
<!--
<table class="report_chart_table">
	<tr>
		<td>
			<div class="report_chart">
				<div class="report_chart_item">
					<div class="report_chart_item_date">均</div>
					<div style="height:<?=round($sum/$day_count)?>px;background:#AA0000;" title="<?=round($sum/$day_count)?>" class="report_chart_item_show"></div>
				</div>
			<foreach name="res" item="row">
				<div class="report_chart_item">
					<div class="report_chart_item_date" title="{$row.info.time|date='Y-m-d l',###}">
						{$row.info.time|date='d',###}
					</div>
					<div style="height:{$row.info.sum|round=###}px;" class="report_chart_item_show"></div>
				</div>
			</foreach>
			</div>
		</td>
	</tr>
</table>
-->
<!--start.clear-->
<div style="clear:both;height:0;"></div>
<!--end.clear-->

<div class="item2">
	<table>
		<tr>
			<th colspan="2">统计报表</th>
		</tr>
		<tr>
			<td width="100">统计天数</td>
			<td>{$day_count}天 ({$inc_range.time_min|date='Y/m/d',###} ~ {$inc_range.time_max|date='Y/m/d',###})</td>
		</tr>
		<tr>
			<td>金额总计</td>
			<td>{$sum|money_num=###}</td>
		</tr>
		<tr>
			<td>日均</td>
			<td>
				<?php
					echo money_num(round($sum/$day_count, 2));
				?>
			</td>
		</tr>
		<tr>
			<td>已选中总金额</td>
			<td><span class="checked_sum imp">0</span></td>
		</tr>
	</table>
</div>

<div class="item2">
<form action="__URL__/inc_add_do" method="post">
	<table>
		<tr>
			<th colspan="2">添加数据</th>
		</tr>
		<tr>
			<td width="100">分类</td>
			<td class="frm"><input type="text" name="cat_id" value="1" /></td>
		</tr>
		<tr>
			<td>说明</td>
			<td class="frm"><input type="text" name="inc_name" value="" /></td>
		</tr>
		<tr>
			<td>金额</td>
			<td class="frm"><input type="text" name="amount" style="width:50px;" value="" /></td>
		</tr>
		<tr>
			<td>时间</td>
			<td class="frm"><input type="text" name="create_time" value="<?php echo date('Y-m-d')?>" /></td>
		</tr>
		<tr>
			<td></td>
			<td class="frm"><input type="submit" value="提交" /></td>
		</tr>
	</table>
</form>
</div>

<div class="item2">
	<table>
		<tr>
			<th colspan="2">操作</th>
		</tr>
		<tr>
			<td width="100"></td>
			<td>
				<input type="button" onclick="$('.item_one').hide();" value="只显示每日总额" /> 	
				<input type="button" onclick="$('.item_one').show();" value="显示全部" /> 	
			</td>
		</tr>
		<tr>
			<td width="100"></td>
			<td>
				<input type="button" onclick="$('.report_chart_table').show();" value="显示柱形图" />
				<input type="button" onclick="$('.report_chart_table').hide();" value="关闭" />	
			</td>
		</tr>
	</table>
</div>

<!--start.clear-->
<div style="clear:both;height:0;"></div>
<!--end.clear-->
<div class="info">
	Finance~
</div>

<include file="common_footer" />







